-----------------------------------------------------------------------------------------------------------------------
       log:  Z:\interactionmodels\getdata\getdata1_mozaffar.log
  log type:  text
 opened on:  10 Jan 2007, 19:57:20

.  *     ***************************************************************** *;
. *     ***************************************************************** *;
. *       File-Name:      getdata1_mozaffar.do                            *;
. *       Date:           01/08/07                                        *;
. *       Author:         MRG                                             *;
. *       Purpose:        Recode Mozaffar et al. (2003) and relabel.      *;
. *       Input File:     mozaffar.dta, golder1.dta                       *;
. *       Output File:    getdata1_mozaffar.log                           *;
. *       Data Output:    STATA_mozaffar.dta                              *;
. *       Previous file:                                                  *;
. *       Machine:                                                        *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. set mem 10m;
(10240k)

.                             use getdata\mozaffar.dta;

.                      *     ****************************************************************  *;
. *           Summary Statistics                                          *;
. *     ****************************************************************  *;
. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
    countrys |         0
        enep |        62    3.234355    2.699867        1.4       14.9
        enlp |        62    2.340323    1.505894          1        8.8
    dismagni |        62    32.27841    79.64036          1        400
    logmagni |        62    .7030161    .7668696          0      2.602
-------------+--------------------------------------------------------
    proxmity |        62    .6246774    .4255131          0          1
      enpres |        62    2.254839    1.489931          0        7.3
    proxenpr |        62    1.442323    1.177821          0        4.6
    ltfragto |        62    4.382419     2.74622          1       9.91
    fragtosq |        62    26.62613    28.37423          1      98.21
-------------+--------------------------------------------------------
      contot |        62    1.597258     .963064          0       3.24
    intertot |        62    8.193395    6.824679          0    25.4664
    intertsq |        62    51.16194    59.53712          0     208.42
    lmgtrpls |        62    35.26274    67.12064          0     265.65
         elf |        56      .62625    .2404281          0        .93
-------------+--------------------------------------------------------
       pregb |        62    .4206452     .281692          0        .82
     elflmag |        62    .4194211     .602451          0   2.289813
    pregblmg |        62    .3253567    .5026586          0   2.003586

. *     ****************************************************************  *;
. *               Recode and relabel variables to sensible names          *;
. *     ****************************************************************  *;
. rename countrys country;

. label var country "country";

. rename enlp legparties;

. label var legparties "effective number of parliamentary parties";

. rename enep elecparties;

. label var elecparties "effective number of electoral parties";

. rename dismagni avemagnitude;

. label var avemagnitude "average district magnitude";

. rename logmagni logmag10;

. label var logmag10 "log of average district magnitude (base 10) - NOT natural log";

. rename proxmity proximity;

. label var proximity "temporal proximity of legislative and presidential elections";

. rename enpres prescandidate;

. label var prescandidate "effective number of presidential candidates";

. rename proxenpr prox_prescandidate;

. label var prox_prescandidate "proximity * prescandidate";

. rename ltfragto fragmentation;

. label var fragmentation "fragmentation index (mozaffar 2003)";

. rename fragtosq fragmentation2;

. label var fragmentation2 "fragmentation squared";

. rename contot concentration;

. label var concentration "concentration of ethnic groups";

. rename intertot frag_conc;

. label var frag_conc "fragmentation * concentration";

. rename intertsq frag2_conc;

. label var frag2_conc "fragmentation2 * concentration";

. rename lmgtrpls logmag10_frag2_conc;

. label var logmag10_frag2 "logmag10 * fragmentation2 * concentration";

. label var elf "ethno-linguistic group index";

. rename elflmag logmag10_elf;

. label var logmag10_elf "logmag10* elf";

. rename pregblmg pregb_logmag10;

. label var pregb_logmag10 "pregb * logmag10";

. label var pregb "politically relevant ethnic group B count";

. *     ****************************************************************  *;
. *           Create new variables that we might want.                    *;
. *     ****************************************************************  *;
. gen logmag = ln(avemagnitude);

. label var logmag "natural log of average district magnitude";

. *     ****************************************************************  *;
. *       Create necessary interaction terms involving logmag10           *;
. *     ****************************************************************  *;
. gen logmag10_conc = logmag10*concentration;

. label var logmag10_conc "logmag10*concentration";

. gen logmag10_frag = logmag10*fragmentation;

. label var logmag10_frag "logmag10*fragmentation";

. gen logmag10_frag_conc = logmag10*fragmentation*concentration;

. label var logmag10_frag_conc "logmag10 * fragmentation * concentration";

. *     ****************************************************************  *;
. *       Now create necessary interaction terms involving logmag         *;
. *     ****************************************************************  *;
. gen logmag_conc = logmag*concentration;

. label var logmag_conc "logmag*concentration";

. gen logmag_frag = logmag*fragmentation;

. label var logmag_frag "logmag*fragmentation";

. gen logmag_frag_conc = logmag*fragmentation*concentration;

. label var logmag_frag_conc "logmag * fragmentation * concentration";

. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
 elecparties |        62    3.234355    2.699867        1.4       14.9
  legparties |        62    2.340323    1.505894          1        8.8
avemagnitude |        62    32.27841    79.64036          1        400
    logmag10 |        62    .7030161    .7668696          0      2.602
-------------+--------------------------------------------------------
   proximity |        62    .6246774    .4255131          0          1
prescandid~e |        62    2.254839    1.489931          0        7.3
prox_presc~e |        62    1.442323    1.177821          0        4.6
fragmentat~n |        62    4.382419     2.74622          1       9.91
fragmentat~2 |        62    26.62613    28.37423          1      98.21
-------------+--------------------------------------------------------
concentrat~n |        62    1.597258     .963064          0       3.24
   frag_conc |        62    8.193395    6.824679          0    25.4664
  frag2_conc |        62    51.16194    59.53712          0     208.42
logma~2_conc |        62    35.26274    67.12064          0     265.65
         elf |        56      .62625    .2404281          0        .93
-------------+--------------------------------------------------------
       pregb |        62    .4206452     .281692          0        .82
logmag10_elf |        62    .4194211     .602451          0   2.289813
pregb_log~10 |        62    .3253567    .5026586          0   2.003586
      logmag |        62    1.618844      1.7659          0   5.991465
logmag10_c~c |        62    1.173279    1.538905          0    5.31634
-------------+--------------------------------------------------------
logmag10_f~g |        62    3.356764    5.352396          0   20.52978
~0_frag_conc |        62    5.672118    8.517053          0   33.66884
 logmag_conc |        62    2.701537    3.543544          0   12.24354
 logmag_frag |        62    7.729645    12.32561          0   47.27266
logmag_fra~c |        62     13.0607    19.61213          0   77.52715

. describe;

Contains data from getdata\mozaffar.dta
  obs:            62                          
 vars:            25                          24 Dec 2002 10:49
 size:         7,006 (99.9% of memory free)
-------------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label
-------------------------------------------------------------------------------
country         str13  %13s                   country
elecparties     float  %9.0g                  effective number of electoral
                                                parties
legparties      float  %9.0g                  effective number of
                                                parliamentary parties
avemagnitude    float  %9.0g                  average district magnitude
logmag10        float  %9.0g                  log of average district
                                                magnitude (base 10) - NOT
                                                natural log
proximity       float  %9.0g                  temporal proximity of
                                                legislative and presidential
                                                elections
prescandidate   float  %9.0g                  effective number of
                                                presidential candidates
prox_prescand~e float  %9.0g                  proximity * prescandidate
fragmentation   float  %9.0g                  fragmentation index (mozaffar
                                                2003)
fragmentation2  float  %9.0g                  fragmentation squared
concentration   float  %9.0g                  concentration of ethnic groups
frag_conc       float  %9.0g                  fragmentation * concentration
frag2_conc      float  %9.0g                  fragmentation2 * concentration
logmag10~2_conc float  %9.0g                  logmag10 * fragmentation2 *
                                                concentration
elf             float  %9.0g                  ethno-linguistic group index
pregb           float  %9.0g                  politically relevant ethnic
                                                group B count
logmag10_elf    float  %9.0g                  logmag10* elf
pregb_logmag10  float  %9.0g                  pregb * logmag10
logmag          float  %9.0g                  natural log of average district
                                                magnitude
logmag10_conc   float  %9.0g                  logmag10*concentration
logmag10_frag   float  %9.0g                  logmag10*fragmentation
logmag10~g_conc float  %9.0g                  logmag10 * fragmentation *
                                                concentration
logmag_conc     float  %9.0g                  logmag*concentration
logmag_frag     float  %9.0g                  logmag*fragmentation
logmag_frag_c~c float  %9.0g                  logmag * fragmentation *
                                                concentration
-------------------------------------------------------------------------------
Sorted by:  
     Note:  dataset has changed since last saved

. *     ****************************************************************  *;
. *       Now merge this dataset with golder1.dta so that we obtain       *;
. *       variables indicating the year of the election and whether the   *;
. *       country was a dictatorship (Note: no other info is added here). *;
. *     ****************************************************************  *;
. merge using getdata\golder1.dta, keep(year_nyu dictator_nyu) nokeep;

. drop _merge;

. *     ****************************************************************  *;
. *                           Reorder the data                            *;
. *     ****************************************************************  *;
. order country year_nyu dictator_nyu;

. *     ****************************************************************  *;
. *                                   Save                                *;
. *     ****************************************************************  *;
. save    getdata\STATA_mozaffar, replace;
file getdata\STATA_mozaffar.dta saved

.  log close;
       log:  Z:\interactionmodels\getdata\getdata1_mozaffar.log
  log type:  text
 closed on:  10 Jan 2007, 19:57:22
-----------------------------------------------------------------------------------------------------------------------
